package com.example.leetcode;

import java.util.Arrays;

public class RemoveDuplicates {
    public static void main(String[] args) {
        int[] nums = new int[]{1, 1, 2, 2, 3, 3};
        removeDuplicates(nums);
    }

    public static int removeDuplicates(int[] nums) {
        int index_1 = 0;
//        int index_2 = 0;
        for (int i = 1; i < nums.length; i++) {
            if (nums[i] != nums[index_1]) {
                nums[++index_1] = nums[i];
            }
        }
        return ++index_1;
    }
}
